export function getTextRect(ctx: CanvasRenderingContext2D, txt: string, font: string) {
    ctx.font = font;
    ctx.textBaseline = "middle"
    let txtMetr = ctx.measureText(txt);
    return {
        w: txtMetr.width,
        // h: txtMetr.actualBoundingBoxAscent,
        h: txtMetr.actualBoundingBoxAscent + txtMetr.actualBoundingBoxDescent,
        // h: txtMetr.fontBoundingBoxAscent + txtMetr.actualBoundingBoxAscent 
    }
}